import java.util.LinkedList;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * User: 花海
 * Date: 2022-11-25
 * Time: 15:55
 */
public class Main {
    public  static boolean judge(LinkedList<Character>list){
        int left=0;
        int right=list.size()-1;
        while(left<right){
            if(list.get(left)!=list.get(right)){
                return false;
            }
            left++;
            right--;
        }
        return true;
    }
    public static void again(String str, LinkedList<Character>list){
        for (int i = 0; i <str.length() ; i++) {
            list.add(str.charAt(i));
        }
    }
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);

/*     *//*  while (sc.hasNextLine())*//*{*/
        System.out.println("dnila");
            String str="aa";

            String str1="a";
            LinkedList<Character>list=new LinkedList<>();

            for (int i = 0; i <str.length() ; i++) {
                list.add(str.charAt(i));
            }

            int count=0;

            for (int i = 0; i <=str.length(); i++) {
                for (int j = 0; j < str1.length(); j++) {
                    list.add(i,str1.charAt(j));

                }
                if(judge(list)){
                    count++;
                }
                list.clear();
                again(str,list);



            }
            System.out.println(count);
        }
    }
/*}*/
